﻿using MediatR;
using StoreIGet.Applications.Command;
using StoreIModels;
using StoreRepositorys.Interface;

namespace StoreIGet.Applications.CommandHandler
{
    public class StoreFandCommandHandler : IRequestHandler<StoreFandCommand, StoreModel>
    {
        public readonly IStoreRepository _storeRepository;
        public StoreFandCommandHandler(IStoreRepository storeRepository)
        {
            _storeRepository = storeRepository;
        }
        public async Task<StoreModel> Handle(StoreFandCommand request, CancellationToken cancellationToken)
        {
            return await _storeRepository.GetModelasync(request.Id);
        }
    }
}
